﻿<?php
session_start();
if (!isset($_SESSION['usuario'])) {
    header('Location: ../viewer/vLogin.php');
}

include_once '../db/DBConnection.php';
DataBase::createConection();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php require("../viewer/vLayoutHead.php"); ?>
    </head>
    <body>

        <?php require("../viewer/vLayoutBody.php"); ?>


        <div id="side-col">
            <br></br>

            <form name="exclusaoProdutos" action="../controller/cExclusaoProdutos.php" method="POST">
            <?php
            $produtos= "SELECT serial,nome FROM produtos";
            $result= mysql_query($produtos);
            $options= "";
            
            while ($row=  mysql_fetch_array($result)) {
                $serial=$row["serial"]; 
                $nome=$row["nome"]; 
                $options.="<OPTION VALUE=\"$serial\">".$nome; 
            }
            ?>
            
            <p>Escolha um produto a ser excluído:</p>
            <select name="nome" required>
                <?= $options ?>
            </select>
            
            <p><input type="submit" class="button red bigrounded" value="Excluir"/></p>
            </form>
            
            <br></br><br></br>
        </div>
    </body>
    <footer>
        <?php require("../viewer/vLayoutFooter.php"); ?>
    </footer>
</html>